#ifndef __TEST_H__
#define __TEST_H__

#include "IBarrier.h"
#include "cpp_framework.h"

using namespace CMDR;

#define MATRIX_FILE_NAME "matrix3.txt"

class MatrixContainer;
class MatrixArray;

enum TestType
{
	Counter,
	LocalCounter,
	Matrix
};

class Test 
{
protected:
	IBarrier* barrier;

public:
	void setBarrier(IBarrier* barrier);
	virtual void performTest() = 0;
};

class TestFactory {
public:
	Test* createTest(IBarrier* barrier, TestType testType);

};

class CounterTest : public Test
{
private:
	AtomicInteger counter;
public:
	virtual void performTest();
};

class LocalCounterTest : public Test
{
private:
	int counter;	
public:
	virtual void performTest();
};

class MatrixTest : public Test
{
private:
	MatrixArray* matArray;
public:
	MatrixTest();
	virtual void performTest();
};

class MatrixContainer
{
private:
	double* matrix;
	int order;
public:
	MatrixContainer(int order);
	int getOrder();
	double getValue(int row, int col);
	void setValue(int row, int col, double value);
};

class MatrixArray
{
private:
	MatrixContainer** matrices;
	int numOfMatrices;
public:
	MatrixArray(int numOfMatrices);
	int getNumOfMatrices();
	void setMatrix(int index, MatrixContainer* matrix);
	MatrixContainer* getMatrix(int index);
};

class MatrixLoader
{
public:
	MatrixArray* loadMatrices(char* filename);
};

#endif